// 用户相关类型
export interface User {
  id: string;
  username: string;
  email: string;
  phone: string;
  avatar?: string;
  createdAt: string;
  updatedAt: string;
}

// 商品相关类型
export interface Product {
  id: string;
  name: string;
  description: string;
  price: number;
  originalPrice?: number;
  images: string[];
  categoryId: string;
  stock: number;
  sales: number;
  status: 'active' | 'inactive';
  createdAt: string;
  updatedAt: string;
}

// 商品分类类型
export interface Category {
  id: string;
  name: string;
  icon?: string;
  parentId?: string;
  sort: number;
  status: 'active' | 'inactive';
  children?: Category[];
}

// 购物车项目类型
export interface CartItem {
  id: string;
  productId: string;
  product: Product;
  quantity: number;
  selected: boolean;
}

// 订单相关类型
export interface Order {
  id: string;
  userId: string;
  orderNo: string;
  status: 'pending' | 'paid' | 'shipped' | 'delivered' | 'cancelled';
  totalAmount: number;
  shippingAddress: Address;
  items: OrderItem[];
  createdAt: string;
  updatedAt: string;
}

export interface OrderItem {
  id: string;
  productId: string;
  product: Product;
  quantity: number;
  price: number;
}

// 地址类型
export interface Address {
  id: string;
  userId: string;
  name: string;
  phone: string;
  province: string;
  city: string;
  district: string;
  detail: string;
  isDefault: boolean;
}

// API响应类型
export interface ApiResponse<T = any> {
  code: number;
  message: string;
  data: T;
}

// 分页类型
export interface Pagination {
  current: number;
  pageSize: number;
  total: number;
}

export interface PaginatedResponse<T> {
  list: T[];
  pagination: Pagination;
} 